package opengl.program;


public class BlockGLProgram extends BaseGLProgram {

	protected final static String CAMERA_MATRIX_NAME = "cameraMatrix";
	protected final static String MODEL_MATRIX_NAME = "modelMatrix";
	protected final static String BASE_POSITION_NAME = "basePosition";
	

	protected final static String VERT_SHADER_FILE_NAME = "..\\shader\\blockVert.glsl";
	protected final static String FRAG_SHADER_FILE_NAME = "..\\shader\\blockFrag.glsl";

	private int basePositionUniform;
	private int cameraMatrixUniform;
	private int modelMatrixUniform;

	public BlockGLProgram() {
		super();
	}

	public void init() throws Exception {
		initShaders();
		getUniformLocations();
		getAttribLocationes();
	}

	@Override
	protected void initShaders() throws Exception {
		int vs = GLShader.createVertexShader(this, VERT_SHADER_FILE_NAME);
		int fs = GLShader.createFragmentShader(this, FRAG_SHADER_FILE_NAME);
		super.initShaders(vs, fs);
	}

	@Override
	protected void getUniformLocations() {
		super.getUniformLocations();
		cameraMatrixUniform = getUniformLocation(CAMERA_MATRIX_NAME);
		modelMatrixUniform = getUniformLocation(MODEL_MATRIX_NAME);
		basePositionUniform= getUniformLocation(BASE_POSITION_NAME);
	}

	public int getCameraMatrixUniform() {
		return cameraMatrixUniform;
	}

	public int getModelMatrixUniform() {
		return modelMatrixUniform;
	}
	
	public int getBasePositionUniform() {
		return basePositionUniform;
	}
}
